package com.yoda.mall.model.vo;

import com.yoda.mall.model.entity.ums.Admin;
import com.yoda.mall.model.entity.ums.Menu;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.List;

/**
 * @author shawn
 * @date 2022年 12月 16日 10:37
 */
@Data
public class ManagerInfoVo implements Serializable {
    private List<String> roles;
    private String icon;
    private List<Menu> menus;
    private String username;

    public static ManagerInfoVo init(Admin admin ,List<String> roles,List<Menu> menus){
        ManagerInfoVo vo = new ManagerInfoVo();
        BeanUtils.copyProperties(admin,vo);
        vo.setMenus(menus);
        vo.setRoles(roles);
        return vo;
    }
}
